//
//  Status.m
//  OC-微博
//
//  Created by Apple on 15/11/13.
//  Copyright © 2015年 Apple. All rights reserved.
//

#import "Status.h"

@implementation Status
+ (instancetype)initWithdict:(NSDictionary *)dict {
    Status *status = [self new];
    [status setValuesForKeysWithDictionary:dict];

    return status;
}
- (void)setValue:(id)value forKey:(NSString *)key {
    // 判断 key 是否是 user
    if ([key isEqualToString:@"user"]) {
        self.user = [User initWithdict:value];
        return ;
    }
    [super setValue:value forKey:key];
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key{}
//描述对象的信息
- (NSString *)description
{
    NSArray *keys = @[@"id", @"text",@"created_at", @"source",@"pic_urls",@"user"];
   
    return [self dictionaryWithValuesForKeys:keys].description;
}

@end
